package com.dxl.entity;

import com.dxl.enums.SexEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

@Data
@ApiModel("注册")
public class UserRegister {
    @ApiModelProperty(value = "用户名",required = true)
    @NotBlank(message = "用户名不能为空")
    private String name;
    @Length(min = 6, max = 12, message = "请输入6-12位密码")//, groups = {BaseB.class}
    @ApiModelProperty(value = "密码",required = true)
    private String password;
    @ApiModelProperty(value = "性别:1男 2女",required = true,allowableValues = "1,2")
    private SexEnum sex;
    @ApiModelProperty(value = "用户id", hidden = true)
    private String userid;

    public UserRegister(String name, String password, String userid,SexEnum sex) {
        this.name = name;
        this.password = password;
        this.userid = userid;
        this.sex = sex;
    }

}
